﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Microsoft.Practices.EnterpriseLibrary.Validation.Validators;
using Metro.Kashikoi.ServiceContract.Location;

namespace Metro.Kashikoi.ServiceContract.Security
{
    [DataContract(IsReference = true)]
    public class UserGroup
    {
        [DataMember]
        [Key]
        public int Id { get; set; }

        [DataMember]
        [StringLength(255, MinimumLength = 1)]
        [StringLengthValidator(1, 255)]
        [Display(Name = "Group Name")]
        public string GroupName { get; set; }

        [DataMember]
        public virtual IList<UserBase> Users { get; set; }

        [DataMember]
        public virtual IList<string> Permisions { get; set; }

        [DataMember]
        public virtual IList<Region> Routes { get; set; }

        public UserGroup() { }

        public UserGroup(string groupName)
        {
            this.GroupName = groupName;
            //this.Permisions.Add(Security.PermissionType.EditCommunicationSettings.ToString());
        }
    }
}
